﻿<%@ Page Title="Detail" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="VideoDetail.aspx.vb" Inherits="_3dBuzz.VideoDetail" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <style type="text/css">
        .emptypng
        {
           background-image:url("Images/empty.png");
           width: 35px;
           height: 33px
           
          
        }
        
        .smileypng
        {
           background-image:url("Images/smileywaiting.png");
           width: 35px;
           height: 33px
        }
        
        .donesmileypng
        {
           background-image:url("Images/smiley.jpg");
           width: 35px;
           height: 33px
        }
        
            .style1
            {
                width: 100%;
            }
        
            .style2
            {
                width: 583px;
            }
        
        </style>
    <p>
        <br />
   
      </p>       
  

        Selected video:
        <table class="style1">
            <tr>
                <td class="style2">
                              <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
              DataKeyNames="VideoId" DataSourceID="SqlDataSource2">
              <Columns>
                <asp:BoundField DataField="Nickname" HeaderText="Artist Name" ReadOnly="True" 
                      SortExpression="Nickname" >
                  <HeaderStyle CssClass="columnhead" />
                  </asp:BoundField>
                  <asp:BoundField DataField="Title" HeaderText="Title" ReadOnly="True" 
                      SortExpression="Title" >
                  <HeaderStyle CssClass="columnhead" />
                  </asp:BoundField>
                  <asp:BoundField DataField="Description" HeaderText="Description" 
                      SortExpression="Description" >
                  <HeaderStyle CssClass="columnhead" />
                  </asp:BoundField>
                  <asp:TemplateField HeaderText="Showreel">
                       <ItemTemplate>
                            
                            <video  width="320" height="240" controls="controls" preload="metadata">
                            <source src= "<%# Eval("Showreel") %>" type ='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'  />
                            <source src= "<%# Eval("Showreel") %>" type = 'video/ogg; codecs="theora, vorbis"'  />
                                 Your browser does not support the video tag.
                            </video>
                       </ItemTemplate>
                       <HeaderStyle CssClass="columnhead" />
                   </asp:TemplateField>
              </Columns>
          </asp:GridView>
          <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
              ConnectionString="<%$ ConnectionStrings:3dBuzzDatabase %>" 
              ProviderName="<%$ ConnectionStrings:3dBuzzDatabase.ProviderName %>" 
           

              SelectCommand="SELECT Video.[VideoId], Video.[Showreel], Video.[ArtistId], Video.[Title], Video.[Description],  Artists.[Nickname], aspnet_Users.[UserName] FROM  aspnet_Users INNER JOIN (Artists INNER JOIN Video ON Artists.[ID] = Video.[ArtistId]) ON (aspnet_Users.[UserId]=Artists.[ASPUserName])   WHERE ([Video.VideoId]=?)" >
                
                <SelectParameters>
                  <asp:QueryStringParameter Name="VideoId" QueryStringField="VideoId" 
                      Type="Int32" />
              </SelectParameters>
                            
          </asp:SqlDataSource><br />
                    <br />
                    <br />
                    <br />
                </td>
                <td valign=top>
                   Choose tags for this video:<asp:CheckBoxList 
                        ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource3" 
                        DataTextField="Tags" DataValueField="ID">
                    </asp:CheckBoxList>

                    Add new tags here (separate tags by commas, do not put in spaces, Thank You!): <br /> 
                    <asp:TextBox ID="tb_AddTag" runat="server" Width="300px"></asp:TextBox>
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:3dBuzzDatabase %>" 
                        ProviderName="<%$ ConnectionStrings:3dBuzzDatabase.ProviderName %>" 
                        SelectCommand="SELECT [Tags], [ID] FROM [Tags]"></asp:SqlDataSource>
                        <p></p>
                    <asp:Button ID="btn_Tag" runat="server" Text="Tag this Video" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                           <p>
              <asp:Label ID="lbl_like" runat="server" Text="You LIKE! this video"></asp:Label>
          </p>
            <asp:Button ID="btn_like" runat="server" BackColor="#FF9933" BorderColor="Blue" 
                BorderStyle="Ridge" Text="Click to LIKE! this video" /></td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <p>



     <p>
        Comments on this video (you can add your own comments and rating at the bottom of this 
        list):</p>
    <p>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" >
        
            <Columns>
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" >
                <HeaderStyle CssClass="columnhead" />
                </asp:BoundField>
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" >
                <HeaderStyle CssClass="columnhead" />
                </asp:BoundField>
                <asp:BoundField DataField="Comment" HeaderText="Comment" 
                    SortExpression="Comment" >
            
                <HeaderStyle CssClass="columnhead" />
                </asp:BoundField>
            
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:3dBuzzDatabase %>" 
            ProviderName="<%$ ConnectionStrings:3dBuzzDatabase.ProviderName %>" 
            SelectCommand="SELECT [Author], [Comment], [Title] FROM [Comments] WHERE ([Showreel_fkId] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Showreel_fkId" QueryStringField="VideoId" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
 
    </p>

        
    <p>  
        <asp:Label ID="lbl_UserName" runat="server" Text=""></asp:Label> add your own comments here:</p>
    <p>    </p>
         
        Rate this now, how good was this 
        showreel? &nbsp;      
    <asp:Label ID="Label1" runat="server"></asp:Label>
         <asp:Rating ID="Rating1" runat="server" RatingAlign="Horizontal" EmptyStarCssClass="emptypng" 
             FilledStarCssClass="donesmileypng" 
            StarCssClass="donesmileypng" WaitingStarCssClass="donesmileypng" 
            BehaviorID="Rating1_RatingExtender">
        </asp:Rating> 
        <br />
        <br />


             &nbsp;&nbsp;     &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;    <asp:Button ID="btn_Rating" runat="server" Text="Save Rating" /> &nbsp;


        <asp:Label ID="lbl_Thanks" runat="server" Text=" "></asp:Label>


    <p>
      Title: &nbsp;&nbsp;&nbsp;<asp:TextBox ID="tb_Title" runat="server"></asp:TextBox>
    </p>
    <p>
        Comment:</p>
   
    <p>
    &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;   <asp:TextBox ID="tb_Comment" 
            runat="server" Height="181px" Width="525px" 
            TextMode="MultiLine"></asp:TextBox>
    </p>
    <p>
          &nbsp;&nbsp;     &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  
          <asp:Button ID="btn_AddComment" runat="server" Text="Add Comment" />
    </p>  
         <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    <p>
    </p>
</asp:Content>


 
